<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录页面</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css">
    <style>
        body, html {
          height: 100%;
          margin: 0;
          background-color: #e9f5f9;
        }
        .container {
          height: 100%;
          display: flex;
          align-items: center;
          justify-content: center;
          padding: 20px;
        }
        .login-register {
          width: 100%;
          max-width: 450px;
          max-height: 750px;
          padding: 35px;
          background-color: #ffffff;
          border-radius: 10px;
          box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
          min-height: 480px;
          display: flex;
          flex-direction: column;
          justify-content: center;
        }
        .logo {
          text-align: center;
          margin-bottom: 5px;
        }
        .logo img {
          width: 80px;
          height: auto;
        }
        h2 {
          text-align: center;
          margin-bottom: 20px;
          color: #333;
        }
        .btn-primary {
          border: none;
          font-size: 16px;
          padding: 10px 0;
          border-radius: 5px;
          transition: all 0.3s ease;
        }
        .btn-primary:hover {
          background-color: #0056b3;
        }
        .form-group {
          margin-bottom: 20px;
        }
        .form-control {
          border-radius: 5px;
          height: 45px;
        }
        .form-control:focus {
          border-color: #007bff;
          box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
        }
    </style>
</head>
<body>
<div class="container">
    <div class="login-register">
        <div class="logo">
            <img src="/shanzhu.png" alt="Logo"> <!-- 替换为你的logo URL -->
        </div>
        <h2>论文期刊管理系统</h2>
        <form th:action="@{/login}" method="post">
            <div class="form-group">
                <label for="loginUsername">用户名</label>
                <input type="text" class="form-control" id="loginUsername" name="username" placeholder="请输入有效的用户名" required>
            </div>
            <div class="form-group">
                <label for="loginPassword">密码</label>
                <input type="password" class="form-control" id="loginPassword" name="password" placeholder="请输入您的密码" required>
            </div>
            <div class="form-group">
                <label for="loginRole">身份</label>
                <select class="form-control" id="loginRole" name="role" required>
                    <option value="USER">普通用户</option>
                    <option value="ADMIN">管理员</option>
                </select>
            </div>
            <button type="submit" class="btn btn-primary btn-block">登录</button>
            <p th:text="${errorMsg}" style="color:red;"></p>
        </form>
        <div class="text-center">
            <a href="/register">还没有账户？点击注册</a>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.min.js"></script>
</body>
</html>
